﻿@using HrEFCore
@model HF
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<!-- 引入样式 -->
	<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
	<!-- 引入组件库 -->
	<script src="https://unpkg.com/element-ui/lib/index.js"></script>
	<script src="~/aa/jquery-3.4.1.js"></script>
	<script src="~/aa/jquery.validate.js"></script>
	<script src="~/aa/jquery.validate.unobtrusive.js"></script>
	<script src="~/aa/vue/dist/vue.js"></script>
	<script src="~/aa/element-ui/lib/index.js"></script>
	<link href="~/aa/element-ui/lib/theme-chalk/index.css" rel="stylesheet" />
	<script src="~/aa/axios/dist/axios.js"></script>
	<link rel="stylesheet" href="~/css/table.css" type="text/css"></link>
	<script type="text/javascript" src="~/javascript/comm/comm.js"></script>
	<script type="text/javascript" src="~/javascript/jquery-1.7.2.js"></script>
	<style type="text/css">
		.s {
			color: red;
		}
	</style>
	<style type="text/css">
		body {
			background: rgb(253,244,227);
		}

		.TD_STYLE1 {
			background: #E6DDCE;
			/* color:white; */
		}

		.TD_STYLE2 {
			background: rgb(253,244,227);
		}

		.INPUT_STYLE2 {
			background: rgb(253,244,227);
		}
	</style>
</head>
<body>
	<form action="/MC/MCAdd" method="post" enctype="multipart/form-data" id="mcAdd">
		<table width="100%">
			<tr>
				<td>
					<font color="black">您正在做的业务是：人力资源--调动管理--调动登记 </font>
				</td>
			</tr>
			<tr>
				<td align="right">
					<input type="submit" value="提交" class="BUTTON_STYLE1" />
					<input type="button" value="返回" class="BUTTON_STYLE1"
						   onclick="history.back()">
				</td>
			</tr>
		</table>
		<span style="font-size:10px">调动次数：@Model.MajorChangeAmount</span>
		<table width="100%" border="1" cellpadding=0 cellspacing=1
			   bordercolorlight=#848284 bordercolordark=#eeeeee
			   class="TABLE_STYLE1 table-bordered">
			<tr height="21">
				<td class="TD_STYLE1" width="8%">
					档案编号
				</td>
				<td class="TD_STYLE2" width="13%">
					<input type="text" name="HumanId" readonly="readonly" value="@Model.HumanId" class="form-control" />
				</td>
				<td class="TD_STYLE1" width="6%">
					姓名
				</td>
				<td class="TD_STYLE2" width="10%">
					<input type="text" name="HumanName" readonly="readonly" value="@Model.HumanName" class="form-control" />
				</td>
				<td class="TD_STYLE1" width="8%">
				</td>
				<td class="TD_STYLE2" width="10%">
				</td>
				<td class="TD_STYLE1" width="8%">
				</td>
				<td class="TD_STYLE2" width="10%">
				</td>
			</tr>
			<tr>

				<td class="TD_STYLE1" width="8%">
					原一级机构
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="FirstKindName" readonly="readonly" value="@Model.FirstKindName" class="form-control" />
					<input type="text" name="FirstKindId" readonly="readonly" style="display:none" value="@Model.FirstKindId" class="form-control" />
				</td>
				<td class="TD_STYLE1" width="8%">
					原二级机构
				</td>
				<td class="TD_STYLE2" width="10%">
					<input type="text" name="SecondKindName" readonly="readonly" value="@Model.SecondKindName" class="form-control" />
					<input type="text" name="SecondKindId" readonly="readonly" style="display:none" value="@Model.SecondKindId" class="form-control" />
				</td>
				<td class="TD_STYLE1" width="8%">
					原三级机构
				</td>
				<td class="TD_STYLE2" width="10%">
					<input type="text" name="ThirdKindName" readonly="readonly" value="@Model.ThirdKindName" class="form-control" />
					<input type="text" name="ThirdKindId" readonly="readonly" style="display:none" value="@Model.ThirdKindId" class="form-control" />
				</td>
				<td class="TD_STYLE1" width="8%">
				</td>
				<td class="TD_STYLE2" width="10%">
				</td>
			</tr>

			<tr>
				<td class="TD_STYLE1">
					原职位分类
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="MajorKindName" readonly="readonly" value="@Model.HumanMajorKindName" class="form-control" />
					<input type="text" name="MajorKindId" readonly="readonly" style="display:none" value="@Model.HumanMajorKindId" class="form-control" />
				</td>
				<td class="TD_STYLE1" width="12%">
					原职位名称
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="MajorName" readonly="readonly" value="@Model.HunmaMajorName" class="form-control" />
					<input type="text" name="MajorId" readonly="readonly" style="display:none" value="@Model.HumanMajorId" class="form-control" />
				</td>
				<td class="TD_STYLE1">
					原薪酬标准
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="SalaryStandardName" readonly="readonly" value="@Model.SalaryStandardName" class="form-control" />
					<input type="text" name="SalaryStandardId" readonly="readonly" style="display:none" value="@Model.SalaryStandardId" class="form-control" />
				</td>
				<td class="TD_STYLE1">
					原薪酬总额
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="SalarySum" readonly="readonly" value="@Model.SalarySum" class="form-control" />
				</td>
			</tr>
			<tr>
				<td class="TD_STYLE1">
					新机构名称
				</td>
				<td class="TD_STYLE2">
					<el-cascader :options="options" v-model="value" v-on:change="handleChange"></el-cascader>
					<input type="text" style="display:none" v-model="firstid" name="NewFirstKindId" />
					<input type="text" style="display:none" v-model="secondid" name="NewSecondKindId" />
					<input type="text" style="display:none" v-model="thirdid" name="NewThirdKindId" />
				</td>
			</tr>
			<tr>
				<td class="TD_STYLE1">
					新职位分类
				</td>
				<td class="TD_STYLE2">
					<select id="HumanMajorKindId" name="NewMajorKindId" v-model="HumanMajorKindId" v-on:change="getName" class="form-control">
						 @foreach (var item in ViewBag.cmk as IEnumerable<SelectListItem>)
						{
							<option value="@item.Value">@item.Text</option>
						} 
					</select>
				</td>
				<td class="TD_STYLE1" width="12%">
					新职位名称
				</td>
				<td class="TD_STYLE2">
					<select name="NewMajorId" class="form-control">
						 <option v-for="item in MajorName" :value="item.majorId">{{item.majorName}}</option>
					</select> 
				</td>
				<td class="TD_STYLE1">
					新薪酬标准
				</td>
				<td class="TD_STYLE2">
					@* @Html.DropDownListFor(e=>e.SalaryStandardId,ViewBag.xc as IEnumerable<SelectListItem>,new{@class="form-control",onchange="handleChange2('SalaryStandardId')"}) *@
					<select name="NewSalaryStandardId" v-model="newsalarySun" v-on:change="handleChange2" class="form-control">
						@foreach (var item in ViewBag.xc as IEnumerable<SelectListItem>)
						{
							<option value="@item.Value">@item.Text</option>
						}
					</select>
				</td>
				<td class="TD_STYLE1">
					新薪酬总额
				</td>
				<td class="TD_STYLE2">
					<input type="text" class="form-control" name="NewSalarySum" v-model="money"/>
				</td>
			</tr>

			<tr>
				<td class="TD_STYLE1">
					登记人
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="Register" readonly="readonly" value="@ViewBag.uname"
						   class="form-control">
				</td>
				<td class="TD_STYLE1">
					登记时间
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="RegistTime" class="form-control" value="@DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")" readonly="readonly" />
				</td>
				<td class="TD_STYLE1">
				</td>
				<td class="TD_STYLE2">
				</td>
				<td class="TD_STYLE1">
				</td>
				<td class="TD_STYLE2">
				</td>
			</tr>
			<tr>
				<td class="TD_STYLE1">
					调动原因
				</td>
				<td colspan="7" class="TD_STYLE2">
					<textarea class="form-control" name="ChangeReason"></textarea>
				</td>
			</tr>
		</table>
	</form>
	<script>
		new Vue({
			el: '#mcAdd',
			data: {
				value: "",
				options: [],
				firstid: "",
				secondid: "",
				thirdid: "",
				HumanMajorKindId: '',
				MajorName: [],
				salary:[],
				newsalarySun:'',
				money:''
			},
			methods: {
				fill() {
					axios.get('/HF/GetFirstKinds').then(res => {
						this.options = res.data.map(item => {
							return {
								value: item.value,
								label: item.label,
								children: item.children
							};
						});
					}).catch(err => {
						console.log(err);
					})
				},
				handleChange(value) {
					console.log('值', value);
					if (value != null) {
						this.firstid = value[0];
						this.secondid = value[1];
						this.thirdid = value[2];
					}
				},
				getName: function () {
					axios.get('/HF/GetName', {
						params: {
							id: this.HumanMajorKindId
						}
					}).then(res => {
						this.MajorName = res.data;
					}).catch(err => {
						console.log(err);
					})
				},
				handleChange2() {
					axios.get('/MC/GetSSNameById', {
						params: {
							salayid: this.newsalarySun
						}
					}).then(res => {
						this.salary = res.data;
						console.log("res.data:"+res.data);
						this.money = res.data.salarySum;
					}).catch(err => {
						console.log(err);
					})
				}
			},
			mounted: function () {
				this.fill();
			}
		})
	</script>
</body>
</html>